package com.example.shop.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.time.LocalDateTime;

import lombok.*;
import lombok.experimental.Accessors;

/**
* <p>
* 用户的商品收藏夹
* </p>
*
* @author 作者
* @since 2022-05-29
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("r_user_goods_collection")
public class UserGoodsCollection extends Model<UserGoodsCollection> {

    private static final long serialVersionUID = 1L;

    /**
     * 收藏夾所屬的用戶id
     */
    @TableId(value = "user_id", type = IdType.ASSIGN_ID)
    private Long userId;
    /**
     * 被收藏的商品
     */
    private Long goodsId;
    /**
     * 收藏的时间
     */
    @TableField(value = "goods_collection_datetime")
    private LocalDateTime goodsCollectionDateTime;

    @Override
    public String toString() {
        return "UserGoodsCollection{" +
                "userId=" + userId +
                ", goodsId=" + goodsId +
                ", goodsCollectionDateTime=" + goodsCollectionDateTime +
                '}';
    }
}
